package com.lanou.controller;

import com.lanou.entity.PsyTest;
import com.lanou.service.PsyTestService;
import com.lanou.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName PsyTestController
 * @Description TODO
 * @Author lizhenjiang
 * @Date 2025年08月13日 16:43
 * @Version 1.0
 */
@RestController
@RequestMapping("PsyTest")
public class PsyTestController {
    @Autowired
    private PsyTestService psyTestService;

    @GetMapping("{id}")
    public R getPsyTestById(@PathVariable Integer id) {
        return R.ok(psyTestService.getPsyTest(id));
    }

    @GetMapping("getPages")
    public R getPsyTestList(PsyTest psyTest, @RequestParam(value = "pageNum",defaultValue = "1",required = false) Integer pageNum, @RequestParam(value = "pageSize",defaultValue = "10",required = false) Integer pageSize) {
        return R.ok(psyTestService.getPsyTests(psyTest, pageNum, pageSize));
    }
}
